<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Habilita Examen</title>
        <link rel="stylesheet" type="text/css" href="style.css" media="screen"/>
        <script language="JavaScript" src="scripts/utilesAlumno.js"></script>
        <script language="JavaScript" src="scripts/utilesRendir.js"></script>
        <script language="JavaScript" src="scripts/modal.js"></script>
        <script language="JavaScript">
            function validarPin()
            {                
                if(document.habExam.pin.value == "")
                {
                    alert("ERROR: debe ingresar el Pin")
                    return false
                }                
            }
        </script>
    </head>
    <body>        
        <div id="container">
            <div id="header">
                <div id="headerLeft">
                    <h1><span style="color:#599EC8;">EXAMENES</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;WEB</h1>
                </div>
                
                <form id="formSalir" name="formSalir" method="post" action="Control" class="formulario">
                    <div id="pass" align="right">
                        <a href="cambiaPassw.jsp" target="_new"><strong><font color="#000000">Cambiar contraseña</font></strong></a>
                        <input type="hidden" name="opcion" value="logout">
                        <input type="submit" name="logout" value="Logout"/>
                    </div>       
                </form>                                    
            </div>
        </div><br/>
        
        <c:if test="${usuActivo.nombre == null || usuActivo.tipoS != 'A'}">
             <div align=center>
                <strong><font color="#993300">Usted no se ha logueado apropiadamente.</font></strong><br/>
                <a>&nbsp;</a>
             </div>
         </c:if>  
      
         <c:if test="${usuActivo.nombre != null && usuActivo.tipoS == 'A'}">
             
             <div id="menu">
                 <ul>
                     <form id="formBoton" name="formBoton" method="post" action="Control" class="formulario">
                         <input type="hidden" name="opcion" value="homeAlum">
                         <input type="hidden" name="idalumno" value="${usuActivo.idUsu}">
                         <input type="submit" name="cargar" value="Home" class="boton">
                     </form>
                     <li><a href="materiasAlumnos.jsp">Materias</a></li>
                 </ul>
             </div>
             
             <c:if test="${param.msg == 'REGINCOM'}">
                 <div align=center>
                     <strong><font color="#993300">Debe completar todos los campos requeridos.</font></strong><br/>
                     <a>&nbsp;</a>
                 </div>
             </c:if>
             
             <c:if test="${param.msg == 'FAILCARG'}">
                 <div align=center>
                     <strong><font color="#993300">El pin introducido no es el correcto.</font></strong><br/>
                     <a>&nbsp;</a>
                 </div>
             </c:if>   
                        
             <h1 id="title">Habilitar examen de ${param.nomMat}</h1>
             
             <form id="habExam" name="habExam" method="post" action="Control" onsubmit="return validarPin()">
             <input type="hidden" name="opcion" value="habilitaExamenA">
             <input type="hidden" name="idalumno" value="${usuActivo.idUsu}">
             <input type="hidden" name="examen" value="${param.idexamen}">
             <input type="hidden" name="nomMat" value="${param.nomMat}">            
             <br>
             <table width="309" align="center">
                 <tr>
                     <td width="150">Ingresar Pin: </td>
                     <td width="206">
                         <input type="text" name="pin" value=""/>                    
                     </td>
                 </tr>
             </table>
             <br>
             <div align="center">
                 <input type="submit" value="Habilitar Examen" name="rendir"/>
             </div>
             <c:if test="${param.msg == 'EXITO'}">
                 <div align=center>
                     <strong><font color="#993300">El examen se habilito para volver a rendir.</font></strong><br/>
                     <a>&nbsp;</a>
                 </div>                
             </c:if>
          </c:if>
        </form>
    </body>
</html>